package yannan.voiplock4ble.bean.ble;

import yannan.voiplock4ble.utils.ByteUtils;

/**
 * 说明：发送升级包命令的响应
 * 作者：mainTel
 * 时间：2017/2/10 18:40
 * 备注：
 */

public class UpdatePktACK extends BaseBleResponse {


    /*
    //APP_Send_Upgrade_Pkt_ACK_ID
//门锁响应升级包
typedef struct{
	AppCommandHead_T head;
	uint8_t		cmd;
	uint8_t   reserve;	//对齐保留
	uint16_t	token;
	uint8_t		reason;						//升级包接收响应结果  0:正常 其它值出错
	uint16_t	pkt_sn;						//门锁接收到的包序号
}UserUpdatePktAck_t;
     */

    public int pkt_sn;
    public boolean reason;

    public UpdatePktACK(byte[] response) {
        super(response);
        reason = (content[0] & 0xff) == 0;
        pkt_sn = Integer.parseInt(ByteUtils.bytesToHexString(new byte[]{content[2], content[1]}), 16);
    }
}
